package cn.huapu.power.energy.vo;


import cn.huapu.power.energy.cons.ReturnCode;

import java.io.Serializable;

public class Ret implements Serializable{	
	private static final long serialVersionUID = 1L;

	private int code = ReturnCode.SUCESS;
	private String msg = "success";
	private Object data;
	public Ret() {		
	}	
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
	
	public void OK(String msg,Object data) {
		this.code = ReturnCode.SUCESS;
		this.msg = msg;
		this.data = data;		
	}
	public void OK(Object data) {
		this.code = ReturnCode.SUCESS;	
		this.data = data;		
	}
	public void Error(String msg,Object data) {
		this.code = ReturnCode.ERROR;
		this.msg = msg;
		this.data = data;		
	}
	public void Error(String msg,Object data,int code) {
		this.code = code;
		this.msg = msg;
		this.data = data;
	}
	
	@Override
	public String toString() {
		return "Ret [code=" + code + ", msg=" + msg + ", data=" + data + "]";
	}
}
